home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 752 b | 42 lines | [TEXT/R*ch] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 9, example 4
-
- -- create the initial module with the exported variables
- -- x, y and z
-
- module XYZ
- uses ScriptX
- exports x, y, z
- end
- in module XYZ
- global x := 10
- global y := "foo"
- global z := #(56,567)
-
- -- Now create a module that uses XYZ and imports all the
- -- variables from it.
-
- module XYZimport1
- uses ScriptX
- uses XYZ with imports everything end
- end
- in module XYZimport1
- print x
- print y
- print z
-
- -- Here's a third module that imports only x and z
- -- note that y is undefined within the context of this module.
-
- module XYZimport2
- uses ScriptX
- uses XYZ with imports x, z end
- end
- in module XYZimport2
- print x
- print z
- -- this should generate an exception
- print y
- -->>>